<template>
  <div class="problem-container">
    <div class="problemBox">
      <div class="title">
        <div class="titleName">{{ problems.title }}</div>
        <div class="expand" @click="handleClick">展开</div>
      </div>
      <div class="info">
        <div class="handle">
          <div>掌握程度:</div>
          <el-rate v-model="value" size="small"></el-rate>
        </div>
        <div class="number">题数: 0/{{ problems.number }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { ref } from "vue";
import { ElMessage } from "element-plus";
export default {
  props: {
    problems: {
      type: Object,
      required: true,
    },
  },
  setup() {
    let value = ref(null);
    const handleClick = () => {
      ElMessage({
        message: "别点了,没做这功能。",
        type: "warning",
        center: true,
      });
    };
    return {
      value,
      handleClick,
    };
  },
};
</script>

<style lang="less" scoped>
.problemBox {
  width: 250px;
  height: 100px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3), -2px -2px 8px rgba(0, 0, 0, 0.3);
  margin-top: 20px;
  margin-left: 10px;
  margin-bottom: 20px;
  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    .titleName {
      font-weight: 700;
    }
    .expand {
      cursor: pointer;
      color: rgb(26, 143, 246);
      font-size: 13px;
    }
  }
  .info {
    margin-left: 10px;
    color: rgb(153, 153, 153);
    font-size: 13px;
    .handle {
      display: flex;
      align-items: center;
      margin-bottom: 8px;
      div {
        margin-right: 5px;
      }
    }
  }
}
</style>
